function e(e) {
    return 1 * e > 9 ? e : "0" + e;
}

function t(t, n) {
    var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "-", i = new Date(t), a = i.getFullYear() + r + e(i.getMonth() + 1) + r + e(i.getDate());
    return n && 1 == n ? a + " " + e(i.getHours()) + ":" + e(i.getMinutes()) + ":" + e(i.getSeconds()) : n && 2 == n ? a + " 00:00:00" : n && 3 == n ? e(i.getHours()) + ":" + e(i.getMinutes()) + ":" + e(i.getSeconds()) : n && 4 == n ? e(i.getMonth() + 1) + r + e(i.getDate()) : n && 5 == n ? a + " " + e(i.getHours()) + ":" + e(i.getMinutes()) : a;
}

function n(e) {
    var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 410;
    arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
    if (e) {
        if (-1 != e.indexOf("img.jikni.com")) {
            var n = "?";
            return e && -1 != e.indexOf("?") && (n = "&"), e + n + "x-oss-process=image/resize,w_" + t;
        }
        return -1 != e.indexOf("res.xcx.weijuju.com") && e.indexOf("?") < 0 ? wx.getSystemInfoSync().system.indexOf("Android") > -1 ? e + "?imageMogr2/auto-orient/thumbnail/!80p/quality/40/format/webp" : e + "?imageMogr2/auto-orient/thumbnail/!80p/quality/40" : e;
    }
    return "";
}

module.exports = {
    changeEducation: function(e) {
        var t;
        switch (e) {
          case 1:
            t = "大专";
            break;

          case 2:
            t = "本科";
            break;

          case 3:
            t = "研究生";
            break;

          case 4:
            t = "硕士";
            break;

          default:
            t = "不限";
        }
        return t;
    },
    getWeek: function(e) {
        var t = void 0;
        switch (new Date(e).getDay()) {
          case 0:
            t = "周日";
            break;

          case 1:
            t = "周一";
            break;

          case 2:
            t = "周二";
            break;

          case 3:
            t = "周三";
            break;

          case 4:
            t = "周四";
            break;

          case 5:
            t = "周五";
            break;

          case 6:
            t = "周六";
            break;

          default:
            t = "^_^";
        }
        return t;
    },
    nowdate: t,
    imgAddTime: function(e) {
        return n(e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 410, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "");
    },
    getTimer: function(e) {
        return e.indexOf("-") && (e = e.replace(/-/gi, "/")), new Date(e).getTime();
    },
    imgKeepWidth: n,
    getNodeTop: function(e, t) {
        var n = wx.createSelectorQuery();
        n.select(e).boundingClientRect(), n.selectViewport().scrollOffset(), n.exec(function(e) {
            if (e[0]) {
                var n = e[0].top;
                t(n);
            }
        });
    },
    changeLabelBgc: function(e) {
        return e < 100 ? "rgba(185,185,185,0.7)" : e >= 100 && e < 200 ? "rgba(255,243,139,0.7)" : e >= 200 && e < 500 ? "rgba(255,190,26,0.7)" : e >= 500 ? "rgba(255,126,13,0.7)" : void 0;
    },
    changeChatTime: function(e) {
        var n = 1e3 * e;
        return new Date(t(new Date(), 2, "/")).getTime() < n ? t(n, 3).split(":")[0] + ":" + t(n, 3).split(":")[1] : t(n, 1).split(":")[0] + ":" + t(n, 1).split(":")[1];
    },
    minArr: function(e, t) {
        var n = e[0][t];
        return e.forEach(function(e) {
            e[t] < n && (n = e[t]);
        }), n;
    },
    maxArr: function(e, t) {
        var n = e[0][t];
        return e.forEach(function(e) {
            e[t] > n && (n = e[t]);
        }), n;
    },
    dblstring: e,
    add0: function(e) {
        return (e + "").length > 5 ? e : new Array(6 - (e + "").length).join(0) + e;
    }
};